//
//  RootTabBarViewController.swift
//  NavgationDemo
//
//  Created by 肖伟华 on 2021/11/28.
//

import UIKit

class RootTabBarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.

        self.tabBar.backgroundColor = .lightGray

        let test1 = Test1ViewController.init()
        let test2 = Test2ViewController.init()
        let test3 = Test3ViewController.init()
        let test4 = Test4ViewController.init()

        self.addNav(childVC: test1, title: "Test1")
        self.addNav(childVC: test2, title: "Test2")
        self.addNav(childVC: test3, title: "Test3")
        self.addNav(childVC: test4, title: "Test4")
    }

    func addNav(childVC: UIViewController, title:String) {
        let nav = BaseNavigationController(rootVC: childVC)
        childVC.title = title
        self.addChild(nav)
    }
}
